import Axios from 'axios';
import env from './env'


const api = `${env.oauthHost}/api/runtime/query/list`;


const exportReplayToken = `${env.oauthHost}/api/runtime/form/getReplayToken`

//获取操作日志接口
const exportXtrz = `${env.oauthHost}/api/runtime/query/list`;
//获取接收情况接口
const exportJsqk = `${env.oauthHost}/api/runtime/query/getJsqk`;
//获取利用情况接口
const exportLyqk = `${env.oauthHost}/api/runtime/query/getLyqk`;
//获取管理情况接口
const exportGlqk = `${env.oauthHost}/api/runtime/query/getGlqk`;
//获取流程列表
const exportLclb = `${env.oauthHost}/api/runtime/workflow/list_workitems`;

//获取用户访问数接口
const exportYhfs = window.location.origin+`/dashboard/v1/datalogic/v2/chartdata`;
export default {
  // 获取列表信息
  getList(params: any): Promise<any> {
    return Axios.post(`${api}`, params);
  },


  //获取replayToken
  exportReplayToken() {
    return Axios.get(`${exportReplayToken}`);
  },
  //获取操作日志
  exportXtrz(params: any) {
    return Axios.post(`${exportXtrz}`, params);
  },
  //获取接受情况
  exportJsqk(params: any) {
    return Axios.post(exportJsqk+`?time=${params.time}&type=${params.type}`);
  },
  //获取利用情况
  exportLyqk(params: any) {
    return Axios.post(exportLyqk+`?time=${params.time}&type=${params.type}`);
  },
  //获取管理情况情况
  exportGlqk(params: any) {
    return Axios.post(exportGlqk+`?time=${params.time}&type=${params.type}`);
  },
  exportLclb(params: any) {
    return Axios.get(exportLclb+`?workflowName=&workflowCode=&originator=&unitType=&startTime=${params.startTime}&endTime=${params.endTime}&originatorName=&activityName=&participant=&participantName=&participantId=&participantUnitType=&workflowKeyWord=&status=PENDING&page=0&size=20&queryType=all`);
  },
  //获取用户访问数
  exportYhfs(params: any) {
    return Axios.post(`${exportYhfs}`, params);
  },
};
